﻿using System.Collections.Generic;
using System.Linq;
using EPiServer.Core;  

namespace EPiBoost.Core.Model
{
	public class NavigationLink
	{

		public virtual int TreeDepth { get; set; }

		public virtual int Index { get; set; }
		public virtual bool IsFirst { get { return Index == 0 ;} }
		public virtual bool IsLast { get; set; }
		
		public virtual PageData Page { get; set; }
		public virtual List<NavigationLink> ChildNavigationLinks { get; private set; }
		public virtual NavigationLink ParentNavigationLink { get; set; }
		
		public virtual bool IsCurrentPage { get; set; }
		public virtual bool IsAncestorOfCurrentPage { get; set; }
		public virtual bool HasChildNavigationLinks
		{
			get { return ChildNavigationLinks != null && ChildNavigationLinks.Any(); }
		}
		  

		public NavigationLink()
		{
			ChildNavigationLinks = new List<NavigationLink>();
		}
	}
}
